package com.sz.biz.rpt.service.impl;

import com.sz.biz.rpt.entity.RptSaleSummary;
import com.sz.biz.rpt.entity.RptSaleSupplier;
import com.sz.biz.rpt.service.RptSaleSupplierService;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Function: //TODO ADD FUNCTION. <br>
 * Date: 2017年12月05日 11:47 <br>
 * Author: wentao.chang
 */
@Service
public class RptSaleSupplierServiceImpl  extends AbstractService implements RptSaleSupplierService {
    @Override
    public int save(RptSaleSupplier rss) {
        return dao.save("RptSaleSupplierMapper.insert",rss);
    }

    @Override
    public int update(RptSaleSupplier rss) {
        return dao.update("RptSaleSupplierMapper.updateById",rss);
    }

    @Override
    public int delete(int id) {
        return dao.delete("RptSaleSupplierMapper.deleteById",id);
    }

    @Override
    public RptSaleSupplier findById(int id) {
        return (RptSaleSupplier)dao.findForObject("RptSaleSupplierMapper.selectById",id);
    }

    @Override
    public void deleteByDate(Date dateBegin) {
        dao.delete("RptSaleSupplierMapper.deleteByDate", dateBegin);
    }

    @Override
    public List<RptSaleSupplier> findByParam(Map<String, Object> params) {
        return  dao.findForList("RptSaleSupplierMapper.findByParam", params,RptSaleSupplier.class);
    }
}
